﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using Projecturo.ProjecturoClient.View;
using Projecturo.ProjecturoClient.ViewModel.Login;
using Projecturo.ProjecturoClient.ViewModel;
using Projecturo.Model;

namespace Projecturo.ProjecturoClient
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            LoginView loginView = new LoginView();
            ViewModelBase loginViewModel = ViewModelManager.Instance.CreateViewModel(typeof(LoginInformation));
            loginViewModel.CloseRequested += delegate
            {
                ViewModelManager.Instance.ReleaseViewModel(loginViewModel.ViewModelReference.CurrentViewModelId);
                loginView.Close();
            };
            loginView.DataContext = loginViewModel;
            loginView.Show();
        }
    }
}
